Origin Script Tool

I. Introduction
II. Installation 
III. Usage
IV. Adding User Defined Categories
V. Adding User Defined Scripts
VI. Adding Status Bar Comments for User Defined Scripts 
VII. Pre-defined Scripts by Category
VIII. New Categories and Scripts


I. Introduction
This document contains installation and usage instructions for the Origin 
Script tool.  The Origin Script tool was designed to meet a number of 
customer needs.  It is primarily intended as a vehicle to provide example 
LabTalk scripts.  The first release of the Origin Script tool contains twenty 
well documented scripts that demonstrate how to use various LabTalk 
commands and object properties and methods.  The Script tool is also 
intended to be a convenient user interface for organizing, selecting, 
displaying, and executing any one of a large number of LabTalk scripts.  
Finally, a number of the example scripts provided are useful programs in 
and of themselves.


II. Installation 
Installation of the Origin Script tool requires that Origin 5.0 or Origin 6.0 
be properly installed on your computer.  To install the Origin Script tool 
follow the steps below:

	1. Double-click on the self extracting zip file SCRIPTS.EXE.  You
	   must extract the contents of SCRIPTS.EXE into a folder having
	   the default name Scripts.
	2. Copy the newly extracted folder named Scripts (and all of its
	   contents) into your Origin software folder.
	3. Copy the files CUSTOM.OGS and SCRIPT.OGO from the
	   ...\Origin\Scripts subfolder into the ...\Origin software folder.


III. Usage
Once the Origin Script tool is installed, click on the Custom Routine 
button (looks like a Fortran flow chart) on the Standard toolbar to open the 
Script tool.  Select a script category from the Category list box and then 
select a script in the chosen category from the Script list box.  The most 
recent argument string passed to the selected script is displayed in the 
Arguments edit box and a short description of the selected script is 
displayed on the Origin Status Bar.  Click the Display button to open the 
selected script file in a Notepad window or click the Run button to execute 
the selected script.  Be sure to read the Description, Assumptions, and 
Arguments sections in the NotePad display window before executing the 
script.  Click the Exit button to close the Script tool.


IV. Adding User Defined Categories
To add a user defined category to the Script tool add a line in the 
[Categories] section of the file ...\Origin\Scripts\SetUserScripts.ogs.  The 
new line should have the form Script!CatCmbx.V$=CatName; where 
CatName is the name of the new category.  Then, add a new section at the 
bottom of the file SetUserScripts.ogs having the form [CatName] and add 
at least one ScriptName to the new category's section (see section V. 
below for how to add ScriptNames to a category).  Finally, create a 
subfolder in the ...\Origin\Scripts folder with the name CatName.  User 
defined CatNames should not contain spaces and should be unique.

For example, to add a new category named "UserDefined" add the line 
Script!CatCmbx.V$=UserDefined; in the [Categories] section of the file 
...\Origin\Scripts\SetUserScripts.ogs (not ...\SetScripts.ogs).  Then, add the 
new section [UserDefined] below the [Worksheet] section and add at least 
one ScriptName to the [UserDefined] section.  Finally, create a subfolder 
named UserDefined in the ...\Origin\Scripts folder.  The changes described 
in this example have already been made to the Script tool for your 
inspection.


V. Adding User Defined Scripts
To add a user defined script to a category add a line in that category's 
section in the file ...Origin\Scripts\SetUserScripts.ogs.  The new line 
should have the form Script!ScriptCmbx.V$=ScriptName; where 
ScriptName is the name of the new script.  Then, create a text file in the 
folder ...\Origin\Scripts\CatName with the name ScriptName.ogs.  The 
main body of your script's code must be placed in the [ScriptName] 
section of this text file.  User defined ScriptNames should not contain 
spaces and should be unique.
                             
For example, to add a new script named ReadMe in the UserDefined
category add the line Script!ScriptCmbx.V$=ReadMe; in the 
[UserDefined] section of the file ...\Origin\Scripts\SetUserScripts.ogs (not 
...\SetScripts.ogs).  Then, create a text file named ReadMe.ogs in the 
subfolder ...\Origin\Scripts\UserDefined.  The main body of code of the 
ReadMe script must be placed in the [ReadMe] section of the text file 
ReadMe.ogs.  The changes described in this example have already been 
made to the Script tool for your inspection.  


VI. Adding Status Bar Comments for User Defined Scripts
If you want to have an informative message displayed in Origin's
Status Bar when your user defined script is selected you must modify
the text file ...\Origin\Scripts\Script.ini.  Either add or edit the
[CatName] section of the file Script.ini so that it contains the
following lines:

[CatName]
CHOICE=1
msgScriptName=ScriptName does thus and such when executed

For example, to have an informative message displayed in Origin's Status 
Bar when the ReadMe script in the UserDefined category is selected 
modify the file Script.ini so that it contains the lines:

[UserDefined]
CHOICE=1
msgReadMe=ReadMe documents how to add user defined script 
categories and scripts to the Script tool

The changes described in this example have already been made to the 
Script tool for your inspection.  


VII. Pre-defined Scripts by Category

Analysis - FitPLabel, Normalize, Redirect2Notes, VLine
Excel - PlotLabel
Graph - LabelXY
Import - Batch
Matrix - Multiply
Numeric - Factorial
String - Parse
Utility - ProgressLoop1, ProgressLoop2, RepairOPJ
Window - ListNonMin
Worksheet - AveDupXY, CopyRows, DelDupXRows, DeleteRows,         
            Row2Label
UserDefined - ReadMe


VIII. New Categories and Scripts
The current release of the Origin Script tool contains ten categories and 
twenty scripts.  You can certainly (and hopefully will) add your own user 
defined categories and scripts.  Microcal hopes to continue to release new 
categories and scripts in the future as part of an on-going documentation 
project.